package com.my.demoredis.repository;

import com.my.demoredis.domain.Person;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.CrudRepository;

import java.util.List;

/**
 * Classname: PersonRepository
 * Package: com.my.demoredis.repository
 * Description:
 *
 * @Author Alex Liang
 * @Create 2024/7/6 下午8:38
 * @Version 1.0
 */

public interface PersonRepository extends CrudRepository<Person,String> {
    /**
     * 自定义个性查询方法，方法名需要符合特定的规范
     */

    List<Person> findByLastName(String lastName);
    Page<Person> findPersonByLastName(String lastName, Pageable pageable);
    List<Person> findPersonByLastNameAndFirstName(String lastName, String firstName);
    List<Person> findByAddress_City(String city);
    List<Person> findByFamilyList_Name(String name);







}
